package connect_mgr

func eventString(uEvent int) string {

	switch uEvent {
	case 0:
		return "SDK退出"
	case 1:
		return "系统错误"
	case 2:
		return "登录结果"
	case 3:
		return "注销登录"
	case 4:
		return "冲突被踢下线"
	case 5:
		return "与对端的P2P通道已连接"
	case 6:
		return "与对端的P2P通道已断开"
	case 7:
		return "对端已经离线"
	case 8:
		return "隧道映射添加"
	case 9:
		return "隧道映射删除"
	case 10:
		return "隧道映射已连接"
	case 11:
		return "隧道映射已断开"
	case 12:
		return "P2P服务器推送消息"
	case 13:
		return "P2P连接通道的信息"
	case 14:
		return "节点转发的状态信息"
	case 15:
		return "节点转发的状态信息"
	case 16:
		return "节点转发的贡献统计信息"
	case 17:
		return "节点转发的消费统计信息"
	}
	return ""
}

//static int StatConnect = 0;

func channelString(id int) string {
	switch id {
	case -1:
		return "离线"
	case 0:
		return "未知"
	case 4:
		return "公网ipv4"
	case 5:
		return "全锥nat"
	case 6:
		return "ip受限nat"
	case 7:
		return "端口受限nat"
	case 8:
		return "对称nat"
	case 12:
		return "私网直连"
	case 24:
		return "p2p转发"
	case 128:
		return "p2p连接"
	case 129:
		return "私网连接"
	case 130:
		return "节点转发"
	case 131:
		return "中继转发"
	case 65535:
		return "对端不在线"
	}
	return ""
}

func httpError(id int) string {
	switch id {
	case 0:
		return "成功"
	case 1:
		return "系统错误"
	case 2:
		return "参数错误"
	case 9:
		return "密码错误"
	case 10:
		return "未登陆"
	case 11:
		return "网络错误"
	case 12:
		return "操作超时"
	case 13:
		return "拒绝访问"
	}
	return ""
}
